﻿{% extends "base.html" %}
{% block title %} 打分 {% endblock %}
{% block user %} 打分 {% endblock %}
{% block styles %}{{super()}}
<link href="{{ url_for("static", filename="css/dashboard.css") }}" rel="stylesheet">
<style>
  .col-center-block {
    float: none;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
</style>
{% endblock %}
{% block scripts %}{{super()}}
<script>
  $(function () {
    $('.datepicker').datepicker({
      format: 'mm/dd/yyyy',
      startDate: '-3d',
      todayBtn: true,
      todayHighlight: true
    });
  });
</script>
{% endblock %}


{% block content %}
<div class="container-fluid">
  <div class="main">
    <div class="row">
      <div class="col-xs-12 col-sm-12 col-md-11 col-lg-8 col-center-block">
        {% include 'flash_message.html' %}
        <h3 class="row page-header" style="text-align:center">
          {{ users[0][1] }} 向 {{ users[1][1] }} 打分
        </h3>


        <form class="form-horizontal" action="{{ url_for('bp_partner.grade', assignment_id=assignment[0]) }}"
          method="POST">

          <div class="form-group">
            <label for="jobno" class="col-sm-2 control-label">工作令号</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" value="{{ assignment[9] + ' ' + assignment[10]  }}"
                readonly="readonly">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">任务摘要</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" value="{{ assignment[1] }}" readonly="readonly">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">任务明细</label>
            <div class="col-sm-10">
              <textarea class="form-control" rows="3" readonly="readonly">{{ assignment[2] }}</textarea>
            </div>
          </div>

          <input style="display: none" type="text" class="form-control" name="senderid" value="{{ users[0][0] }}"
            readonly="readonly">
          <input style="display: none" type="text" class="form-control" name="receiverid" value="{{ users[1][0] }}"
            readonly="readonly">
          <input style="display: none" type="text" class="form-control" name="assignmentid" value="{{ assignment[0] }}"
            readonly="readonly">


          <div class="form-group">
            <label class="col-sm-2 control-label">开始日期</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" value="{{ assignment[3].strftime('%m/%d/%Y')  }}"
                readonly="readonly">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">结束日期</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" value="{{ assignment[4].strftime('%m/%d/%Y')  }}"
                readonly="readonly">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">权重</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" value="{{ assignment[5] }}" readonly="readonly">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">成绩</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" name="grade" placeholder="0~100" pattern="\d{1,2}$|100" required>
            </div>
          </div>

          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <button type="submit" class="btn btn-default">打分</button>
              <button class="btn btn-default" onclick="javascript:history.go(-1)">返回</button>
            </div>
          </div>
        </form>

      </div>
    </div>
  </div>
</div>
{% endblock %}